﻿using RabbitMQ.Client;
using System;
using System.Text;

namespace FanoutModePublish
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            var channel = Common.RabbitMQ.GetChannel();

            //交换机
            channel.ExchangeDeclare("myfanoutexchange", ExchangeType.Fanout, true, false, default);

            //队列
            //channel.QueueDeclare("myfanoutqueue", true, false, false, default);

            for (int i = 0; i < 100; i++)
            {
                channel.BasicPublish("myfanoutexchange", string.Empty, default, Encoding.UTF8.GetBytes($"你好{i}"));
            }

        }
    }
}
